package ICOM5016.DAO;


import java.util.HashMap;
import java.util.Map;

import ICOM5016.DTO.Item;

public class ItemDAO {
	private Map<String, Item> itemMap;
	private static final ItemDAO singleton = new ItemDAO();

	public static final ItemDAO getInstance(){
		return singleton;
	}

	private ItemDAO(){
		this.itemMap = new HashMap<String, Item>();
		this.itemMap.put("electronics", new Item("Macbook", "$1,500", "Laptop", "0-000-1", "electronics"));
	}

	public synchronized boolean newItem(){
		//creates new item
		return true;
	}

	public synchronized Item getItem(String query) {
		return this.itemMap.get(query);
	}
}

